<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<script type="text/javascript">
	

	$(function() {
		
		$('#pid').combotree({
			url : '${ctx}/cate/tree?flag=false',
			parentField : 'pid',
			lines : true,
			panelHeight : 'auto',
			value :'${cate.pid}'
		});
		
		
		
		$('#cateEditForm').form({
			url : '${ctx}/cate/edit',
			onSubmit : function() {
				progressLoad();
				var isValid = $(this).form('validate');
				if (!isValid) {
					progressClose();
				}
				return isValid;
			},
			success : function(result) {
				progressClose();
				result = $.parseJSON(result);
				if (result.success) {
					parent.$.modalDialog.openner_treeGrid.treegrid('reload');//之所以能在这里调用到parent.$.modalDialog.openner_treeGrid这个对象，是因为organization.jsp页面预定义好了
					parent.$.modalDialog.handler.dialog('close');
				}
			}
		});
		
	});
</script>
<div style="padding: 3px;">
	<form id=cateEditForm" method="post">
		<table class="grid">
			<tr>
				<td>栏目名称</td>
				<td><input name="id" type="hidden"  value="${cate.id}"><input name="name" type="text" value="${cate.name}" placeholder="请输入栏目名称" class="easyui-validatebox" data-options="required:true" ></td>
				<td>英文缩写</td>
				<td><input name="alias" type="text" value="${cate.alias}" placeholder="请输入英文缩写" class="easyui-validatebox" data-options="required:true" ></td>
				
			</tr>
			<tr>
				<td>排序</td>
				<td><input name="seq" value="${cate.seq}" class="easyui-numberspinner" style="width: 140px; height: 24px;" required="required" data-options="editable:false" value="0"></td>
				<td>上级栏目</td>
				<td>
					<select id="pid" name="pid" style="width:150px;height: 24px;"></select>
					<a class="easyui-linkbutton" href="javascript:void(0)" onclick="$('#pid').combotree('clear');" >清空</a>
				</td>
			</tr>
			<tr>
				<td>菜单图标</td>
				<td><input  name="icon" value="${cate.icon}"/></td>
				<td>是否生成首页</td>
				<td>
					<input type="radio" name="iscreateindex" value="0" checked="checked" />不生成
					<input type="radio" name="iscreateindex" value="1" />生成
				</td>
			</tr>
			<tr>
				<td>关键词</td>
				<td colspan="3"><textarea rows="1" cols="50" name="keywords"  placeholder="请输入关键词" class="easyui-validatebox" >${cate.keywords}</textarea></td>
				
			</tr>
			
			<tr>
				<td>描述</td>
				<td colspan="3"><textarea rows="1" cols="70" name="description"  placeholder="请输入描述" class="easyui-validatebox" >${cate.description}</textarea></td>
			</tr>
		</table>
		
	</form>
</div>
